Home:ALL Converter>Is there a way to completely disable DTR line of serial port in Windows?

Is there a way to completely disable DTR line of serial port in Windows?

Ask Time:2022-06-25T06:10:44         Author:Ar7eniyan

Json Formatter

I'm working on Arduino Uno project which requires serial port comminication. On my Arduino board DTR pin of USB-UART chip is used to reboot MCU (It's connected to reset pin through capacitor) and that's what I dont't want it to do. Serial port driver on Windows changes DTR line state when the port is opened (resetting the board) and there is 3 options of fDtrControl in Win32 API:

From Microsoft Docs:

fDtrControl

The DTR (data-terminal-ready) flow control. This member can be one of the following values.

Value Meaning
DTR_CONTROL_DISABLE
0x00
Disables the DTR line when the device is opened and leaves it disabled.
DTR_CONTROL_ENABLE
0x01
Enables the DTR line when the device is opened and leaves it on.
DTR_CONTROL_HANDSHAKE
0x02
Enables DTR handshaking. If handshaking is enabled, it is an error for the application to adjust the line by using the EscapeCommFunction function.

Author:Ar7eniyan,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/72749851/is-there-a-way-to-completely-disable-dtr-line-of-serial-port-in-windows
yy